
#include "ServerMessage.h"


ServerMessage::ServerMessage(void)
{
}


ServerMessage::~ServerMessage(void)
{
}

bool ServerMessage::CreateNewUser( const std::string& user_id,const std::string& user_name )
{
    CreateMsgPacket();
    CreateMessage(user_id,"",LOGIN);
    CreateBody(user_name);
    return true;
}

bool ServerMessage::CreateUserLogout( const std::string& user_id,const std::string& user_name )
{
    CreateMsgPacket();
    CreateMessage(user_id,"",LOGOUT);
    CreateBody(user_name);
    return true;
}

bool ServerMessage::CreateShake( const std::string& from_user_id,const std::string& to_user_id )
{
    CreateMsgPacket();
    CreateMessage(from_user_id,to_user_id,SHAKE);
    return true;
}

bool ServerMessage::CreateChat( const std::string& from_user_id,const std::string& to_user_id,const std::string& data )
{
    CreateMsgPacket();
    CreateMessage(from_user_id,to_user_id,CHAT);
    CreateBody(data);
    return true;
}
